<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
	<style>
		* {
			margin: 0;
			padding: 0;
		}

		h1 {
			height: 100px;
			line-height: 100px;
			background-color: gray;
			text-align: center;
		}

		@media (min-width:500px) and (max-width:700px) {
			h1 {
				background-color: blue;
			}
		}

		@media (max-width:400px) {
			h1 {
				background-color: green;
			}
		}

		@media (min-width:900px) {
			h1 {
				background-color: green;
			}
		}

		/* min-width:800px表示大于等于800px，
		加上not就是小于800px，会显示的样式 */
		@media (max-width:800px) {
			h1 {
				background-color: red;
			}
		}
	</style>
</head>

<body>
	<h1>新年快乐</h1>
</body>

</html>